﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNet.Random.String
{
    /// <summary>
    /// 键盘上一般字符随机类，继承于StringRandService
    /// </summary>
    public class KeyboardLetterRandService : StringRandService
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="KeyboardLetterRandService" /> class.
        /// </summary>
        /// <param name="count">The count.</param>
        /// <param name="join">The join.</param>
        /// <exception cref="System.Exception">count is too long</exception>
        public KeyboardLetterRandService(int count, string join)
            : base(count, join)
        {
            var serail = ConstUtility.EnglishLowerLetter;
            foreach (var item in serail)
            {
                this.Serial.Add(item);
            }
            serail = ConstUtility.EnglishUpperLetter;
            foreach (var item in serail)
            {
                this.Serial.Add(item);
            }
            serail = ConstUtility.SpecialChar;
            foreach (var item in serail)
            {
                this.Serial.Add(item);
            }
            if (count > 83)
            {
                throw new Exception("count is too long");
            }
        }
    }
}
